package untiring07.swing.jdbc;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Toolkit;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class J26_SungJukMainFrame extends JFrame {

	private JPanel contentPane;
	private static J26_SungJukMainFrame frame;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame = new J26_SungJukMainFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public J26_SungJukMainFrame() {
		setResizable(false);
		setTitle("스윙");
		setIconImage(Toolkit.getDefaultToolkit().getImage(J26_SungJukMainFrame.class.getResource("/images/1385384498_yahoo_messenger.png")));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("파일(F)");
		menuBar.add(mnFile);
		
		JMenuItem miNew = new JMenuItem("새 성적(N)");
		miNew.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new J26_SungJukNewData(frame);
			}
		});
		mnFile.add(miNew);
		
		JSeparator separator = new JSeparator();
		mnFile.add(separator);
		
		JMenuItem miExit = new JMenuItem("종료(X)");
		mnFile.add(miExit);
		
		JMenu mnView = new JMenu("보기(V)");
		menuBar.add(mnView);
		
		JMenuItem miList = new JMenuItem("전체 성적 보기(L)");
		mnView.add(miList);
		
		JMenu mnHelp = new JMenu("도움말(H)");
		menuBar.add(mnHelp);
		
		JMenuItem miJelp = new JMenuItem("도움말 항목(H)");
		mnHelp.add(miJelp);
		
		JSeparator separator_1 = new JSeparator();
		mnHelp.add(separator_1);
		
		JMenuItem miAbout = new JMenuItem("프로그램 정보(A)");
		miAbout.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new J26_SungJukAboutDialog(frame);
			}
		});
		mnHelp.add(miAbout);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
	}

}
